<% content_for(:title, t("camaleon_cms.admin.users.create_user")) %>
<div class="login-body">
    <%= render "camaleon_cms/flash_messages" %>

    <h3 class="login-title"><%= raw t('camaleon_cms.admin.login.msg_registration_html') %></h3>
    <%= form_for(@user, as: "user", :url => cama_admin_register_path, :html => { method: "post", role: "form", id:"login_user", class: "form-horizontal cama_form_validate"  } ) do |f| %>
        <%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @user} %>
        <h4><%= t('camaleon_cms.admin.login.personal_info') %></h4>
        <div class="form-group">
            <div class="col-md-12">
                <%= f.text_field :first_name, class: 'form-control required', placeholder: t("camaleon_cms.admin.login.first_name", default: 'First Name') %>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-12">
                <%= f.text_field :last_name, class: 'form-control', placeholder: t("camaleon_cms.admin.login.last_name", default: 'Last Name') %>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-12">
                <%= f.email_field :email, :class => "form-control required email", placeholder: t("camaleon_cms.admin.login.email", default: 'Email') %>
            </div>
        </div>


        <h4><%= t('camaleon_cms.admin.login.authentication') %></h4>
        <div class="form-group">
            <div class="col-md-12">
                <%= f.text_field :username, :class => "form-control required", placeholder: t("camaleon_cms.admin.login.username", default: 'User Name') %>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-12">
                <%= f.password_field :password, :class => "form-control #{"required" if @user.new_record?}", placeholder: t("camaleon_cms.admin.login.password", default: 'Password') %>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-12">
                <%= f.password_field :password_confirmation, :class => "form-control #{"required" if @user.new_record?}", "equalTo" => "#user_password", placeholder: t("camaleon_cms.admin.login.password_confirm", default: 'Password Confirmation') %>
            </div>
        </div>

        <% if current_site.security_user_register_captcha_enabled? %>
            <h4><%= t('camaleon_cms.admin.login.captcha', default: 'Security Code') %></h4>
            <div class="form-group">
                <div class="col-md-12">
                    <%= raw cama_captcha_tag(5, {}, {class: 'form-control required', placeholder: t('camaleon_cms.admin.login.captcha', default: 'Security Code')}) %>
                </div>
            </div>
        <% end %>

        <%= r = {html: "", f: f}; hooks_run("user_register_form", r); raw(r[:html]); %>

        <div class="form-group push-up-30">
            <div class="col-md-6">
                <a href="<%= cama_admin_login_path %>" class="btn btn-link btn-block"><%= t('camaleon_cms.admin.login.already_have_account') %></a>
            </div>
            <div class="col-md-6">
                <button class="btn btn-primary btn-block"><%= t('camaleon_cms.admin.button.sign_up') %></button>
            </div>
        </div>
    <% end %>
</div>
